﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVKPOS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:tra="clr-namespace:WPFExcelReport.TranslationByMarkupExtension;assembly=ReflectionStudio.Core"
                    FontSize="14" 
                    Background="White" 
                    Title="放样通知单" 
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwQPSTEP" Source="{Binding Path=ICC_QPSTEP,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwQPPLAN" Source="{Binding Path=QPPLAN,Source={StaticResource SetQP}}" />
        <CollectionViewSource   x:Key="vwQPZUORD" Source="{Binding Path=QPZUORD,Source={StaticResource SetQP}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="150"></RowDefinition>
            <RowDefinition Height="400"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel Name="zoneCommand" Margin="4,0,51,6" Grid.ColumnSpan="3">
                <Label Content="系统" Width="Auto" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink"  TabIndex="1" />
                <Label Content="语言" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                <Label Content="用户名" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                <Label Content="密码" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow"  KeyboardNavigation.TabIndex="1" TabIndex="4" />
                <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                    登录
                </Button>
                <TextBlock Name="Administration"></TextBlock>
                <CheckBox FontSize="14" Content="属于评审组" Name="IsBelongs2V9"
                              Visibility="Hidden"></CheckBox>
                <TextBlock FontSize="14" MinWidth="200" Width="Auto" Name="MemberV9" Background="#FF00AF00"
                               Visibility="Hidden"></TextBlock>
                <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel >
                <WrapPanel Name="ZoneOrder">
                    <TextBlock Width="Auto">订单号:</TextBlock>
                    <TextBox   Name="txtVKPAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                    <TextBox   Name="txtVKPAUFLFD" KeyDown="txtVKPAUFLFD_KeyDown" MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" TabIndex="12" />
                    <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnGetVKPOS" Click="btnGetVKPOS_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/Search.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <WrapPanel Name="ZoneAccount">
                    <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="14" />
                    <Button   Content="预览" Margin="20,0,0,0" Name="btnPrintPreview" Width="51" Click="btnPrintPreview_Click" TabIndex="15" />
                    <CheckBox Content="送审" FontSize="18" Name="IsSendForAuditing" IsChecked="True" />
                </WrapPanel>
                <WrapPanel Name="ZoneAuditing">
                    <CheckBox Content="审单"
                      FontSize="18"
                      Name="IsOnAuditing" />
                    <Button   Content="预览"
                          Margin="20,0,0,0"
                          Name="btnAuditing"
                          Width="51"
                          Click="btnPrintPreview_Click"
                          TabIndex="15" />
                    <Button Content="发布" Name="btnDistribute" Width="51" Margin="20,0,0,0" Click="btnDistribute_Click" TabIndex="16" />
                </WrapPanel>
            </WrapPanel>
            <WrapPanel>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="客户号:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" 
                                                                 Text="{Binding Path=VKKKUNDNR, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="120" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="发货条件:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Text="{Binding Path=VKKLIEFBED, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="60" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="运输方式:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Text="{Binding Path=VKKVERSART, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="60" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="销售合同:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Grid.Row="0" Height="22" HorizontalAlignment="Left" Margin="2,4,0,8" Text="{Binding Path=VKKBESTNR, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="120" />
                </Grid>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="2"  Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="2"  >
            <DataGrid VerticalAlignment="Top"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}"  
                              HeadersVisibility="Column"
                              x:Name="dgVKPOS"    
                              MaxHeight="150"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" 
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=VKPPOSTYP}" Header="类型"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPZUSATZ, Converter={StaticResource ResourceKey=gb2312}}" Header="标准"  Width="Auto" MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="品种"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=gb2312}}" Header="颜色"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPKDARTNR, Converter={StaticResource ResourceKey=gb2312}}" Header="客人花号"   Width="Auto"  MinWidth="100"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=gb2312}}" Header="" Width="Auto" MinWidth="100"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="单位"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="交期"  Width="Auto" MinWidth="40"/>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <StackPanel Grid.Row="3"   Grid.Column="0" Grid.ColumnSpan="1">
            <WrapPanel>
                <Button Name="btnRefresh" Width="40" Height="40"  Click="btnRefresh_Click" >
                    <Button.Background>
                        <ImageBrush  ImageSource="Images/Reload.png" />
                    </Button.Background>
                </Button>
                <StackPanel>                  
                    <WrapPanel>
                        <TextBlock>质检标准:</TextBlock>
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=QPSPNRKRS, Source={StaticResource ResourceKey=vwQPSTEP} }" VerticalAlignment="Center" Width="30" />
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=QPSPLFDNR, Source={StaticResource ResourceKey=vwQPSTEP}}" VerticalAlignment="Center" Width="80" />
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock Margin="0,0,0,0" Text="WS08" />
                        <Button Margin="20,0,0,0" x:Name="btnWS08Filter" Click="btnWS08Filter_Click" Content="筛选"/>
                        <Button Margin="20,0,0,0" x:Name="btnWS08Clear" Click="btnWS08Clear_Click" Content="清空"/>
                    </WrapPanel>                 
                </StackPanel>
                <StackPanel>
                </StackPanel>
                <StackPanel>
                    <TextBlock>目标:</TextBlock>
                    <WrapPanel>
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=QPSMERKM, Source={StaticResource ResourceKey=vwQPSTEP}}" VerticalAlignment="Center" Width="40" />
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=WAPBEM, Source={StaticResource ResourceKey=vwQPSTEP},  Converter={StaticResource ResourceKey=d10000}}" VerticalAlignment="Center" Width="40" />
                    </WrapPanel>
                </StackPanel>
                <StackPanel>
                    <TextBlock>范围:</TextBlock>
                    <WrapPanel>
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=WAPMIN, Source={StaticResource ResourceKey=vwQPSTEP}, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="40" />
                        <TextBlock>~</TextBlock>
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=WAPMAX, Source={StaticResource ResourceKey=vwQPSTEP}, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="40" />
                    </WrapPanel>
                </StackPanel>
                <StackPanel>
                    <TextBlock>单位:</TextBlock>
                    <WrapPanel>
                        <TextBox Margin="2,0,0,0" Text="{Binding Path=WAPME, Source={StaticResource ResourceKey=vwQPSTEP}}" VerticalAlignment="Center" Width="40" />
                    </WrapPanel>
                </StackPanel>
                <StackPanel></StackPanel>
            </WrapPanel>
            <DataGrid
                    Name="dlgQPSTEP"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwQPSTEP}}"  
                              HeadersVisibility="Column"
                               Height="300"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" 
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=QPSNAUS}" Header="来源"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=QPMBEZ, Converter={StaticResource ResourceKey=gb2312}}" Header="项目"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=QPSNSWERT, Converter={StaticResource ResourceKey=d1000}}" Header="目标"  Width="Auto" MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=QPSNSUG, Converter={StaticResource ResourceKey=d1000}}" Header=">"  Width="Auto" MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=QPSNSOG, Converter={StaticResource ResourceKey=d1000}}" Header="最大"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=QPMMEEH}" Header="单位"  Width="Auto" MinWidth="40"/>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <StackPanel Grid.Row="3"   Grid.Column="1" Grid.ColumnSpan="1">
            <StackPanel Orientation="Horizontal" >
                <WrapPanel>
                    <Button   Name="btnRefreshQP10" Width="40" Height="40" Margin="20,0,0,0"  Click="btnRefreshQP10_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Images/Add.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock>指定质检计划</TextBlock>
                </WrapPanel>
                <TextBlock Margin="20,0,0,0" Text="客户:" />
                <TextBox Margin="20,0,0,0" Name="txtMAT" MinWidth="40"  Height="30" VerticalAlignment="Top"/>
                <Button Margin="20,0,0,0" x:Name="btnFilter" Click="btnFilter_Click"  Height="20"  Content="筛选" VerticalAlignment="Top"/>
                <Button Margin="20,0,0,0" x:Name="btnClear" Click="btnClear_Click"  Height="20"  Content="清空" VerticalAlignment="Top"/>
                <ComboBox  Margin="20,0,0,0"
                                Width="100"
                                SelectedValuePath="QPZART"
                                DisplayMemberPath="QPZART"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwQPZUORD}}" >
                </ComboBox>
            </StackPanel>
            <DataGrid 
                        Name="dlgQPPLAN"
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"  
                EnableColumnVirtualization="False"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwQPPLAN}}"  
                HeadersVisibility="Column" 
                Height="300"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.ColumnSpan="2" Margin="0,0,0,17" 
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=QPPPNRKRS}" Header=""   Width="Auto"  MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=QPPPLFDNR}" Header="质检计划"  Width="Auto" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=QPPSPEZIF, Converter={StaticResource ResourceKey=gb2312}}" Header="说明"   Width="Auto"  MinWidth="120"/>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </Grid>
</local:DocumentBase>